<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
	<!-- jquery -->
	<script src="../js/jquery.min.js"></script>
	<!-- bootstrap -->
	<script src="../js/bootstrap3/js/bootstrap.min.js"></script>
	<link rel="stylesheet" href="../js/bootstrap3/css/bootstrap.css"/>
	<!-- bootstrap table -->
	<script src="../js/bootstrap-table/bootstrap-table.js"></script>
	<link rel="../js/bootstrap-table/bootstrap-table.css"/>
	<script src="../js/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>
	<!-- bootstrap 时间 -->
	<script src="../js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
	<script src="../js/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
	<link rel="stylesheet" href="../js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css">
	<!-- bootstrap 弹框 -->
	<script src="../js/bootstrap-bootbox/bootbox.js"></script>
</head>
<body  background="../js/images/san.jpg" height="313" width="500">
<form id="UserForm" class="form-horizontal">
	<div class="form-group"></div>
	<div class="form-group"></div>
	<div class="form-group">
		<div class="col-sm-3"></div>
		<label  class="col-sm-3 control-label"><h1>注册页面</h1></label>
		<div class="col-sm-6"></div>
	</div>
	<div class="form-group"></div>
	<div class="form-group"></div>
	<div class="form-group"></div>
	<div class="form-group">
		<div class="col-sm-3"></div>
		<label  class="col-sm-2 control-label">账号</label>
		<div class="col-sm-2">
			<input type="text" class="form-control" name="userAccount">
		</div>
		<div class="col-sm-5"></div>
	</div>
	<div class="form-group">
		<div class="col-sm-3"></div>
		<label  class="col-sm-2 control-label">密码</label>
		<div class="col-sm-2">
			<input type="password" class="form-control" name="userPassword">
		</div>
		<div class="col-sm-5"></div>
	</div>
	<div class="form-group">
		<div class="col-sm-5"></div>
		<div class="col-sm-1">
			<button onclick="login()" type="button" class="btn btn-primary btn-lg btn-block">返回</button>
		</div>
		<div class="col-sm-1">
			<button onclick="saveUser()" type="button"  class="btn btn-primary btn-lg btn-block">注册</button>
		</div>
		<div class="col-sm-5"></div>
	</div>

</form>
</body>

<script type="text/javascript">

	function login() {
		location.href="../page/loginchai";
	}

	function saveUser(){

		$.ajax({
			url:'../wjs/register',
			type:'post',
			data:$("#UserForm").serialize(),
			success:function(data){
				if(data){
					bootbox.alert({
						title:'提示',
						message:'注册成功',
						size:'small',
					})
				}else{
					bootbox.alert({
						title:'提示',
						message:'注册失败',
						size:'small',
					})
				}
			}
		})
	}

</script>
</html>